<template name="home_upload_avatar">
  <div class="userimg">
    <div class="position-relative">
      <img src="{{currentAvatar}}">
      <div class="userimg-edit" id="upload-user-img">
        <i class="material-icons">photo_camera</i>
        <span>修改我的头像</span>
      </div>
      <input class="d-none" type="file" accept="image/png,image/jpeg" id="upload-user-img-input">
    </div>
  </div>
  <div class="modal crop-modal" id="crop-user-img-modal" tabindex="-1" role="dialog">
    <div class="modal-dialog modal-dialog-centered" role="document">
      <div class="modal-content">
        <div class="modal-header border-bottom-0 px-0">
          <h5 class="modal-title mx-auto my-3">编辑头像</h5>
          <button type="button" class="crop-modal-close" data-dismiss="modal" aria-label="Close">
            <i class="material-icons">close</i>
          </button>
        </div>
        <div class="modal-body p-0">
          <div id="crop-user-img-content"></div>
        </div>
        <div class="modal-footer border-top-0 px-0">
          {{#if inUploading}}
            <button type="button" class="btn btn-primary mx-auto mb-3" disabled style="width:300px;">
              <div class="btn-loading"><div></div></div>
            </button>
          {{else}}
            <button type="button" class="btn btn-primary mx-auto mb-3" id="save-new-user-img" style="width:300px;">设置为头像</button>
          {{/if}}
        </div>
      </div>
    </div>
  </div>
</template>